package com.eric.rabbit.config;

import com.eric.rabbit.entity.simple.SimpleReceiver;
import com.eric.rabbit.entity.simple.SimpleSender;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author:Eric
 * @date:2021/6/28
 * 简单模式
 * 一个生产者 -> 一个队列 -> 一个消费者
 */
@Configuration
public class SimpleRabbitConfig {

    @Bean
    public Queue hello(){
        return new Queue("simple.hello");
    }

    @Bean
    public SimpleSender simpleSender(){
        return new SimpleSender();
    }

    @Bean
    public SimpleReceiver simpleReceiver(){
        return new SimpleReceiver();
    }

}
